Test Series - java script

Test Number 35/92

Q: The events that are not triggered directly by user activity are called ___________
A. Device-independent input events
B. Device-dependent input events
C. User interface events
D. State change events
Solution: Some events are not triggered directly by user activity, but by network or browser activity, and indicate some kind of lifecycle or state-related change. The load event, fired on the Window object when the document is fully loaded, is probably the most commonly used of these events.
Q: The video and the audio belong to the _________
A. Timers and error handlers
B. API-Specific events
C. State change events
D. User interface events
Solution: The HTML5 video and audio elements define a long list of associated event types such as “waiting”, “playing”, “seeking”, “volumechange”, and so on. These events are usually only of interest to web apps that want to define custom controls for video or audio playback.
Q: The client-side JavaScript asynchronous programming model contains _________
A. Timers and error handlers
B. User interface events
C. State change events
D. API-specific events
Solution: Timers and error handlers are part of client-side JavaScript asynchronous programming model and are similar to events.
Q: Which are the events that have default actions that can be canceled by event handlers?
A. Submit and form-related events
B. Reset and form-related events
C. Submit and reset events
D. form-related events
Solution: The submit and reset events have default actions that can be canceled by event handlers, and some click events do, too. The focus and blur events do not bubble, but all the other form events do.
Q: The events that represent occurrences related to the browser window are _________
A. Window
B. Element
C. Display
D. Handlers
Solution: Window events represent occurrences related to the browser window itself, rather than any specific document content displayed inside the window.
Q: Which event is fired when a document and all of its external resources are fully loaded and displayed to the user?
A. Window
B. Load
C. Element
D. Handler
Solution: The load event is the most important of these events: it is fired when a document and all of its external resources (such as images) are fully loaded and displayed to the user.
Q: Which is the alternative to the load event?
A. readychange
B. changestate
C. readystatechange
D. contentloader
Solution: DOMContentLoaded and readystatechange are alternatives to the load event: they are triggered sooner, when the document and its elements are ready to manipulate, but before external resources are fully loaded.
Q: Which is the opposite of the load event in JavaScript?
A. dontload
B. postload
C. preload
D. unload
Solution: The unload event is the opposite of load: it is triggered when the user is navigating away from a document. An unload event handler might be used to save the user’s state, but it cannot be used to cancel navigation.
Q: Which is the property that is triggered in response to JavaScript errors?
A. onexception
B. onmessage
C. onerror
D. onclick
Solution: The onerror property of the Window object is something like an event handler, and it is triggered in response to JavaScript errors. It isn’t a true event handler, however, because it is invoked with different arguments.
Q: Which event can be fired on any scrollable document element?
A. Window
B. Scroll
C. Load
D. Unload
Solution: Scroll events can also be fired on any scrollable document element, such as those with the CSS overflow property set.

You Have Score    /10